package com.jkoss.biz.imp.jy;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.jkoss.biz.jy.InterviewActionBiz;
import com.jkoss.dao.jy.InterviewMapper;
import com.jkoss.pojo.jy.Interview;
import com.jkoss.tool.Page;

@Component
public class InterviewActionBizImpl implements InterviewActionBiz{
    
	@Autowired
	private InterviewMapper tdao;
	
	@Override
	public List<Interview> listPageItv(Page<Interview> page) {
		
		return tdao.listPageItv(page);
	}

	@Override
	@Transactional
	public String addItv(Interview itv) {
		
		return tdao.insert(itv)>0?"添加成功":"添加失败";
	}

	@Override
	@Transactional
	public String delItv(Integer stumsid) {
		
		return tdao.deleteByPrimaryKey(stumsid)>0?"删除成功":"删除失败";
	}

	@Override
	public Interview oneItv(Integer stumsid) {
		
		return tdao.findById(stumsid);
	}

	@Override
	@Transactional
	public String upItv(Interview itv) {
		
		return tdao.updateByPrimaryKey(itv)>0?"修改成功":"修改失败";
	}

}
